<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
<head>
    <meta charset="utf-8"/>
    <title>CMS后台管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link th:replace="resource :: css" rel="stylesheet"/>
</head>
<body>
<div class="container-fluid">
    <nav class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand" href="javascript:void(0);">用户管理</a>
            </div>
        </div>
    </nav>
    <table class="table table-bordered table-hover">
        <thead>
        <tr>
            <form class="form-inline" role="form" action="list" method="get">
                <td><input type="text" class="form-control" placeholder="ID" name="id" value="$!entity.id"></td>
                <td><input type="text" class="form-control" placeholder="用户名" name="username" value="$!entity.username"></td>
                <td>
                    <select class="form-control" name="group.id">
                        <option value="">全部</option>
                        #foreach($e in $!groups)
                        <option value="$!e.id" #if($!e.id== $!entity.group.id) selected #end>$!e.name</option>
                        #end
                    </select>
                </td>
                <td><input type="text" class="form-control" placeholder="性别" name="gender" value="$!entity.gender.name"></td>
                <td><input type="text" class="form-control" placeholder="真实姓名" name="realname" value="$!entity.realname"></td>
                <td><input type="text" class="form-control" placeholder="出生日期" name="birthday" value="$!entity.birthday"></td>
                <td><input type="text" class="form-control" placeholder="电子邮箱" name="email" value="$!entity.email"></td>
                <td><input type="text" class="form-control" placeholder="电话" name="mobile" value="$!entity.mobile"></td>
                <td><input type="text" class="form-control" placeholder="QQ" name="qq" value="$!entity.qq"></td>
                <td><input type="text" class="form-control" placeholder="地址" name="address" value="$!entity.address"></td>
                <td><input type="text" class="form-control" placeholder="邮编" name="zipCode" value="$!entity.zipCode"></td>
                <td><input type="text" class="form-control" placeholder="状态" name="userState" value="$!entity.userState.name"></td>
                <td width="91px">
                    <button type="submit" class="btn btn-primary btn-xs">查询</button>
                    <a type="button" class="btn btn-success btn-xs" href="add">新增</a>
                </td>
            </form>
        </tr>
        <tr>
            <th>ID</th>
            <th>用户名</th>
            <th width="11010px">用户组</th>
            <th>性别</th>
            <th>真实姓名</th>
            <th>出生日期</th>
            <th>电子邮箱</th>
            <th>电话</th>
            <th>QQ</th>
            <th>地址</th>
            <th>邮编</th>
            <th>状态</th>
            <th width="93px">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="entity : ${page.content}">
        <tr>
            <td th:text="${entity.id}"></td>
            <td th:text="${entity.username}"></td>
            <td th:text="${entity.group.name}"></td>
            <td th:text="${entity.gender.name}"></td>
            <td th:text="${entity.realname}"></td>
            <td th:text="${entity.birthday}"></td>
            <td th:text="${entity.email}"></td>
            <td th:text="${entity.mobile}"></td>
            <td th:text="${entity.qq}"></td>
            <td th:text="${entity.address}"></td>
            <td th:text="${entity.zipCode}"></td>
            <td th:text="${entity.userState.name}"></td>
            <td>
                <a class="btn btn-success btn-xs" data-id="$!entity.id" href="edit?id=$!entity.id">编辑</a>
                <button type="button" class="btn btn-danger btn-xs remove-item" data-id="$!entity.id">删除</button>
            </td>
        </tr>
        </tbody>
    </table>
    #set($i=$!page.number + 1)
    <ul class="pagination" style="float:right" total="$!page.totalPages" index="$i"></ul>
</div>
<script th:replace="resource :: js"></script>
</body>
</html>
